import PropTypes from 'prop-types'
import React, { memo } from 'react'

import RoomItem from '../room-item'
import { RoomWrapper } from './style'

const SectionRoom = memo((props) => {
  const { roomList = [] } = props
  return (
    <RoomWrapper>
      {
        roomList?.slice(0, 8).map((item) => {
          return <RoomItem itemData={item} key={item.id}></RoomItem>
        })
      }
    </RoomWrapper>
  )
})

SectionRoom.propTypes = {
  roomsList: PropTypes.array
}

export default SectionRoom